<template>
	<div class="company-policy-detail">
		<!-- 申报详情 -->
		<div class="detail-nav font13 h99">
			<router-link to="/vip/c_policy_declaration">{{$t('common.newJob.enterpriseCenter')}}</router-link>
			<span>&gt;</span>
			<router-link to="/vip/c_policy_declaration_detail">{{$t('common.detail.policyDetail')}}</router-link>
		</div>
		<div class="company-policy-detail-content" v-if="con.title">
			<div class="company-policy-detail-title">
				<p class="flexCenter">{{con.title}} <span>{{con.applyStatusTxt}}</span></p>
				<p class="font14 h99">{{$t('common.detail.releaseTime')}}：{{con.releaseTime}}</p>
			</div>
			<div class="company-policy-detail-box flexItems">
				<div class="company-policy-detail-box-name">{{$t('common.detail.sourcePolicy')}}：</div>
				<span class="color1">{{con.policyArticles.title}}</span>
			</div>
			<div class="company-policy-detail-box flexItems">
				<div class="company-policy-detail-box-name">{{$t('common.detail.declarationSubject')}}：</div>
				<span>{{con.subjectTypeTxt}}</span>
			</div>
			<div class="company-policy-detail-box flexItems">
				<div class="company-policy-detail-box-name">{{$t('common.detail.declarationTime')}}：</div>
				<span>{{con.beginTime}}   ~   {{con.endTime}}</span>
				<span class="h99">（{{$t('common.company.companytask9')}}）</span>
			</div>
			<!-- <div class="company-policy-detail-boxTitle">{{$t('news.baomCon')}}：</div> -->
			<div class="company-policy-detail-boxContent" v-html="con.briefContent"></div>
			
			<!-- 申报填写提交 -->
			<div class="shenbao">
				<div class="zmlTitle flexItems">{{$t('common.detail.declarationSubmit')}}</div>
				<div class="shenbao-head flexBetween">
					<div><span>{{$t('common.detail.declarationEnterprise')}}：</span><span>{{con.applyName}}</span></div>
					<div><span>{{$t('common.company.applicants')}}：</span><span>{{con.applyNum}}人</span></div>
					<div><span>{{$t('common.company.cashResult')}}：</span><span>{{con.cashinStatusTxt}}</span></div>
				</div>
				<div class="shenbao-ziliao">
					<table>
						<tr>
							<td>{{$t('common.detail.enterpriseInfo')}}</td>
							<td></td>
							<td></td>
						</tr>
						<tr v-for="(item, index) in con.applyMaterialList" :key="index">
							<td>{{item.attachment.name}}</td>
							<td class="h99">{{item.attachment.requirement}}</td>
							<td><a :href='imgUrl+item.attachment.path' class="color1">{{item.attachment.name}}</a></td>
						</tr>
					</table>
				</div>
				<div class="shenbao-info shenbao-ziliao">
					<table>
						<tr>
							<td>{{$t('common.detail.talentInfo')}}</td>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
						<tr v-for="(item, index) in list" :key="index">
							<td>{{item.name}}</td>
							<td>{{item.sexTxt}}</td>
							<td><span class="color1">{{item.materialCount}}份</span>材料</td>
							<td class="h99">{{item.auditOpinion}}</td>
							<td>{{item.cashInTxt}}</td><!--红色的话就加class="color3"-->
						</tr>
					</table>
				</div>
				<div class="shenbao-page flexCenter">
					<el-pagination background
						@current-change="handleCurrentChange"
						:current-page="currentPage"
						:page-size="pageSize"
						layout="prev, pager, next, total, jumper"
						:total="total">
					</el-pagination>
				</div>
			</div>
			
		</div>
	</div>
</template>
<script>
import {getDeclarationApplyCompanyDetail,pageApplyStuffEnterprise} from '@/services/api.js'
import {ajax} from '@/utils/js.js'
export default{
    data(){
      return{
        currentPage: 1, 	//当前页
        pageSize: 10,  		//一页几条
        total: 100,			//总条数
        rencai:[0,1,2,3,4,5,6],
        id:'',
				con:{},
				imgUrl:this.$store.state.imgUrl,
				list:[], //人才信息
				
      }
    },
    mounted() {
			console.log(this.imgUrl)
      let id = this.$route.query.id
      this.id = id
      this.content(id)
    },
    methods:{
      content(id=this.id){
        ajax(this,getDeclarationApplyCompanyDetail,{declarationIssuedId:id},res=>{
          console.log(res.data)
          this.con = res.data
				},err=>{})
				this.getList(id)
			},
			getList(id = this.id){
				ajax(this,pageApplyStuffEnterprise,{declarationIssuedId:id,pageSize:this.pageSize,pageNo:this.currentPage},res=>{
					console.log('个人信息',res.data)
					this.list = res.data.records
					this.total = res.data.total
				},err=>{})
			},
      // 页数改变时触发
      handleCurrentChange(val){
				console.log(`当前页: ${val}`);
				setTimeout(()=>{                                
					this.getList()
				},200)
      },
    }
}
</script>
<style lang="scss">

.company-policy-detail{
	.company-policy-detail-content{
		width: 100%;
		height: auto;
		background-color: #fff;
		padding: 0 130px;
		overflow: hidden;
		.company-policy-detail-title{
			text-align: center;
			padding-top: 44px;
			padding-bottom: 30px;
			p:nth-of-type(1){
				font-size: 22px;
				font-weight: bold;
				margin-bottom: 16px;
				span{
					display: inline-block;
					padding: 3px 7px;
					color: #0F54BC;
					background:rgba(15,84,188,.1);
					font-size: 12px;
					margin-left: 12px;
				}
			}
		}
		.company-policy-detail-box{
			margin-bottom: 16px;
			.company-policy-detail-box-name{
				min-width: 70px;
				margin-right: 35px;
			}
		}
		.company-policy-detail-boxTitle{
			margin: 30px 0;
		}
		.company-policy-detail-boxContent{
			line-height: 22px;
		}
		.shenbao{
			padding-top: 20px;
			.shenbao-head{
				div{
					span:nth-of-type(1){
						margin-right: 20px;
					}
				}
				div:nth-of-type(2){
					flex: 1;
					padding-left: 80px;
				}
			}
			.shenbao-ziliao{
				margin-top: 20px;
				table{width: 100%;}
				tr{
					height: 50px;
					border: 1px solid #EDEDED;
					td{
						padding-left: 30px;
					}
					td .color1{
						text-decoration: underline;
						cursor: pointer;
						margin-right: 12px;
					}
				}
				tr:nth-of-type(1){
					background-color: #F2F6FE;
				}
			}
			.shenbao-info{
				margin-top: 50px;
			}
			.shenbao-page{
				padding: 40px 0;
			}
		}
	}
}
</style>
